package cn.chenhuanming.shh.administer.core.rest;

import cn.chenhuanming.shh.administer.entity.jpa.UserBroker;
import cn.chenhuanming.shh.administer.entity.jpa.UserSystem;
import org.springframework.context.annotation.Configuration;
import org.springframework.data.rest.core.config.RepositoryRestConfiguration;
import org.springframework.data.rest.webmvc.config.RepositoryRestConfigurerAdapter;
import org.springframework.data.web.config.EnableSpringDataWebSupport;
import org.springframework.hateoas.config.EnableHypermediaSupport;

import static org.springframework.hateoas.config.EnableHypermediaSupport.HypermediaType.HAL;

/**
 * Created by chenhuanming on 2017-07-17.
 *
 * @author chenhuanming
 */
@Configuration
@EnableSpringDataWebSupport
@EnableHypermediaSupport(type = HAL )
class CustomRestMvcConfiguration extends RepositoryRestConfigurerAdapter {

    @Override
    public void configureRepositoryRestConfiguration(RepositoryRestConfiguration config) {
        config.exposeIdsFor(UserBroker.class, UserSystem.class);
    }

}
